home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / asm / libmacro.lha / library_macro.doc < prev    next >
Text File  |  1995-04-17  |  4KB  |  129 lines

  1. LIBRARY macro
  2. (c) 1995 Rudla Kudla
  3.  
  4. What is it for
  5.  
  6. This macro will help you to develop Amiga shared libraries in
  7. assembler. Library sources written using this macro are much more readable and
  8. easy to change. New libraries will also use relative mode for function offsets,
  9. which is very rarely used, also much better (in my opinion) than long absolute
  10. pointers often used. Long pointers are however still usable.
  11.  
  12. Installation
  13.  
  14. Copy directory "kudlar/library.i" into your include drawer. (that
  15. drawer with exec, intuition and similar drawers). That's all, you are ready 
  16.  
  17. Usage
  18.  
  19. This is very complicated macro and it's usage is little complex (well, nobody
  20. said that developing library is easy thing). First you need to know, how big
  21. your library base will be. It must be at least LIB_SIZE+4 bytes long. Add total
  22. size of your library variables (bases of some other libraries for example) to
  23. this and you know size of your library base.
  24. Now declare library head like this:
  25.  
  26.     LIBRARY name,version,revision,compilation_date,library_base_size
  27.  
  28. Example:LIBRARY iffparse,37,231,13.4.1995,iff_SIZEOF
  29.  
  30. Now you have to declare names of library functions. Do it this way
  31.  
  32.     LIBRARY FUNCTIONS
  33.     LIBRARY    OpenLib,CloseLib,ExpungeLib,ExtFuncLib
  34.  
  35.     LIBRARY FunctionName1,FunctionName2,FunctionName3
  36.     LIBRARY FuncName
  37.     LIBRARY AnotherFunction
  38.  
  39. You MUST write OpenLib,CloseLib,ExpungeLib and ExtFuncLib as first four
  40. functions of your library. They can have different names, but their function
  41. stays same. They are used when library is being openned or closed. See RKM to
  42. or example.library to read more about it. Following functions are specific to
  43. your library. LIBRARY directive can be followed upto 9 function names.
  44.     If your library is bigger than 32 kB, you can put LIBRARY LARGE after
  45. head. This will force library to use long absolute pointers for functions
  46. offsets instead of relative word pointers.
  47.  
  48. Now follows the code part of library. This is beginning with
  49.  
  50.     LIBRARY CODE
  51.     
  52. Now you can declare bodies of functions with LIBRARY function_name.
  53. function_name must be equivalent to that listed in initialization part. Label
  54. of this name will be created as entry point to function, while
  55. _LVOfunction_name will be initialized to point on right offset relative to
  56. library base. First function, that you daclare this way must be the one with
  57. name Init. This function has none of those labels. This function is
  58. internally used by system to init library.
  59.     You have to supply body for every function listed in declaration part,
  60. otherwise macro will report an error. Warning will be reported also if you
  61. supply body for function not listed there. (uses PRINTT directive to output
  62. text - works in Trash'mOne V1.6).
  63.     Whole library must be ended with directive
  64.     LIBRARY END
  65.  
  66. The best way how to begin writing of library is to modify source of my
  67. example.library.
  68.  
  69. Skeleton of short library:
  70.  
  71.     LIBRARY iffparse,37,231,13.4.1995,iff_SIZEOF
  72.     LIBRARY FUNCTIONS
  73.     LIBRARY    OpenLib,CloseLib,ExpungeLib,ExtFuncLib
  74.     LIBRARY FunctionName1,FunctionName2,FunctionName3
  75.  
  76.     LIBRARY CODE
  77.     LIBRARY Init
  78.     ;Init code
  79.     LIBRARY OpenLib
  80.     LIBRARY CloseLib
  81.     LIBRARY ExpungeLib
  82.     LIBRARY ExtFuncLib
  83.     
  84.     LIBRARY FunctionName1
  85.     LIBRARY FunctionName2
  86.     LIBRARY FunctionName3
  87.         
  88.     LIBRARY END
  89.     
  90. Skeleton of long library:
  91.  
  92.     LIBRARY iffparse,39,112,13.6.1995,iff_SIZEOF
  93.     LIBRARY LARGE
  94.     LIBRARY FUNCTIONS
  95.     LIBRARY    OpenLib,CloseLib,ExpungeLib,ExtFuncLib
  96.     LIBRARY FunctionName1,FunctionName2,FunctionName3
  97.     LIBRARY NewFunction
  98.     
  99.     LIBRARY CODE
  100.     LIBRARY Init
  101.     ;Init code
  102.     LIBRARY OpenLib
  103.     LIBRARY CloseLib
  104.     LIBRARY ExpungeLib
  105.     LIBRARY ExtFuncLib
  106.     
  107.     LIBRARY FunctionName1
  108.     LIBRARY FunctionName2
  109.     LIBRARY FunctionName3
  110.     LIBRARY NewFunction    
  111.     LIBRARY END
  112.     
  113. Contact and other things
  114.  
  115. This is freeware. Use it as you wish (but I recommend you to use it for
  116. developing some library :-). Suggestions etc. sent to:
  117.  
  118. e-mail:  kudlar@risc.upol.cz
  119. www:     http://phoenix.upol.cz/~kudlar/
  120. tel/fax: +42-651-21854
  121. mail:    Rudolf Kudla
  122.          Zerotinova 28/584
  123.          Valasske Mezirici
  124.          75701
  125.          Czech republic
  126.          
  127. I hope, that if you will develop some library using this macro, that you will
  128. send me it.
  129.